let timer: any = null;
export const debounce = (fn: any, ms: any) => {
  return function (...args: any[]) {
    if (timer) {
      clearTimeout(timer);
      timer = null;
    }
    timer = setTimeout(() => {
      fn(...args);
    }, ms);
  };
};
